<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width-device-width,initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="sie-edge" />
<link rel="stylesheet" type="text/css" href="LoginCss/css/style.css">

<title>登录注册页面</title>

<!--图标库-->
<script src="https://unpkg.com/ionicons@4.2.2/dist/ionicons.js"></script>
</head>

<body>
<div class="container" id="container"> 
  <div class="form-container sign-up-container">
    <form action="ZhuChe",method="post" >
      <h1>JCP停车场会员注册</h1>
      <input type="text" required="required" oninvalid="setCustomValidity('请输入正确的手机号');" pattern="(^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8})$" name="phoneNumber" placeholder="请输入手机号码">
      <input type="text" required="required" name="carNumber" placeholder="请输入车牌号码">
      <input type="text" required="required" name="userName" placeholder="请输入姓名">
      <input type="text" required="required" name="carModel" placeholder="请输入车辆型号">
      <input type="text" required="required" name="carColor" placeholder="请输入车辆颜色">
      <input type="password" required="required" oninvalid="setCustomValidity('字母开头，长度在6~18之间，只能包含字母、数字和下划线');" pattern="(^[a-zA-Z]\w{5,17}$)"  name="password" placeholder="请输入密码">
      <button>注册</button>
    </form>
  </div>
  <div class="form-container sign-in-container">
    <form  action="login",method="post">
      <h1>JCP停车场登录</h1>	
      <input type="text" required="required" id="phoneNumber" name="phoneNumber" placeholder="手机号码">
      <input type="password" required="required" id="password" name="password" placeholder="密码">
   	 <input type="hidden" value="${}">
   	 <button id="button">登录</button>

    </form>
  </div>
  <div class="overlay-container">
    <div class="overlay">
      <div class="overlay-panel overlay-left">
        <h1>欢迎回来JCP停车场登入</h1>
        <p>请登录您的个人信息</p>
        <button class="ghost" id="signIn">登录</button>
      </div>
      <div class="overlay-panel overlay-right">
        <h1>欢迎光临</h1>
        <p>输入您的个人资料，并与我们一起开始智慧停车</p>
        <button class="ghost" id="signUp">注册</button>
      </div>
    </div>
  </div>
</div>
 
<script  src="LoginCss/js/script.js"></script> 
<!-- 提示框 -->
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<script type="text/javascript">
	
			$("#button").click(function(){
		    	var phoneNumber = $("#phoneNumber").val();    //用户名
		    	var password = $("#password").val();      //密码
			    $.ajax({  
	                type: "post",  
	                async:true,
	                data:{phoneNumber:phoneNumber,password:password},
	                dataType:"text",
	                url : "login",
	                success: function (data) { 
	                	if(data=="登录失败"){
	                		alert("手机号和密码错误请重新登录");
	                		window.location = "Login.html"
	                	}
	                	else if(data=="管理员登录"){
	                		alert("欢迎观临管理员admin");
	                	}else if(data=="登录成功"){
	                		alert("欢迎光临"+)
	                	}
	              	}   
	           	});
			})
	</script>	
</body>
</html>
